/*
 * AbstractDomain.h
 *
 *  Created on: 30 avr. 2014
 *      Author: anthony
 */

#ifndef ABSTRACTDOMAIN_H_
#define ABSTRACTDOMAIN_H_

class Domain {
public:
	Domain(int borneSup,int borneInf):borneSup(borneSup),borneInf(borneInf),size(borneSup-borneInf){
		valeurs= new bool[size];
		for(int i=0;i<size;i++)valeurs[i]=true;
	}
	virtual ~Domain();
	bool operator [](int index){ if(index>=size){return false;}return this->valeurs+index-borneInf;}
	void remove(int index){valeurs[index-borneInf]=false;size--;
		//TODO ajouter variable dans la queue du propagator
	}
	bool isIn(int value){
		if(value<borneInf || value>borneSup){return false;}
		return this[value-borneInf];
	}
protected:
	int size;
	int borneSup;
	int borneInf;
	bool* valeurs;

};
/**
 *
 * class Domain {
 * int * value;
 * int numValeur;
 * DeltaDomain* delta;
 * }
 *
 * Ex SD :
 *
 * Sparse Set => 2 tableau ;
 * 		-sparse [0, n-1] //position
 * 		-dense [0, n-1] //element
 * 		nb element : numbers [[0, n]
 *
 *
 *
 */

#endif /* ABSTRACTDOMAIN_H_ */
